﻿Imports DTO
Imports BUS

Public Class MH_Main

    Dim ndDTO As New NguoiDungDTO

    Private Sub btnThoat_main_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThoat_main.Click
        Me.Close()
    End Sub

    Private Sub btnThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThoat.Click
        Me.Close()
    End Sub

    Private Sub btnDSMon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDSMon.Click
        Dim mh As New MH_DanhSachMonHoc()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnDSLop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDSLop.Click
        Dim mh As New MH_DanhSachLop
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnDSHSToanTruong_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDSHSToanTruong.Click
        Dim mh As New MH_DanhSachHocSinh()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnDSHSPhanTheoLop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDSHSPhanTheoLop.Click
        Dim mh As New MH_DanhSachHocSinhTheoLop()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnTiepNhanHocSinh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTiepNhanHocSinh.Click
        Dim mh As New MH_TiepNhanHocSinh()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnCapNhatDiemTheoMon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCapNhatDiemTheoMon.Click
        Dim mh As New MH_CapNhatDiemTheoLop_Mon()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnCapNhatDiemCaNhan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCapNhatDiemCaNhan.Click
        Dim mh As New MH_CapNhatDiemCaNhan()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnTheoHocKy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTheoHocKy.Click
        Dim mh As New MH_BaoCaoTongKetHocKy()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnTheoMon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTheoMon.Click
        Dim mh As New MH_BaoCaoTongKetMon()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnTraCuuHS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTraCuuHS.Click
        Dim mh As New MH_TraCuuHocSinh()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnTimKiemCoBan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTimKiemCoBan.Click
        Dim mh As New MH_TimKiemHocSinh()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnTimKiemNangCao_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTimKiemNangCao.Click
        Dim mh As New MH_TimKiemHocSinhNangCao()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnBangDiemLop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBangDiemLop.Click
        Dim mh As New MH_BangDiemLop()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnBangDiemMon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBangDiemMon.Click
        Dim mh As New MH_BangDiemMon()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnBangDiemCaNhan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBangDiemCaNhan.Click
        Dim mh As New MH_BangDiemCaNhan()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnPhanQuyenSuDung_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPhanQuyenSuDung.Click
        Dim mh As New MH_PhanQuyenSuDung()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnThayDoiQuiDinh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThayDoiQuiDinh.Click
        Dim mh As New MH_ThayDoiQuyDinh()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnNhapExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNhapExcel.Click
        MessageBox.Show("chưa có form ... ")
    End Sub

    Private Sub btnXuatExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnXuatExcel.Click
        MessageBox.Show("chưa có form ... ")
    End Sub

    Private Sub btnBackupDatabase_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBackupDatabase.Click
        Dim mh As New MH_BackupDatabase()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnRestoreDatabase_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRestoreDatabase.Click
        Dim mh As New MH_RestoreDatabase()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnGiupDo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGiupDo.Click
        Process.Start(Application.StartupPath + "/Help/Help.chm")
    End Sub

    Private Sub btnThongTin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        MessageBox.Show("chưa có form ... ")
    End Sub

    Private Sub btnDangNhap_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDangNhap.Click
        Dim mh As New MH_DangNhap()
        mh.ShowDialog()
        ndDTO = mh.NguoiDungDTO
    End Sub

    Private Sub btnDangXuat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDangXuat.Click
        MH_Main_Load(sender, e)
        btnDangNhap.Enabled = True
    End Sub

    Private Sub btnDoiMK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDoiMK.Click
        Dim frm As New MH_DoiMatKhau()
        frm.NguoiDungDTO = ndDTO
        frm.ShowDialog()
        ndDTO = frm.NguoiDungDTO 'gán lại mật khẩu mới
    End Sub

    Private Sub btnDoiThongTinCaNhan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        MessageBox.Show("chưa có form ... ")
    End Sub

    Private Sub btnDoiHinhNen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDoiHinhNen.Click
        Dim mh As New MH_DoiGiaoDien()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnThayDoiThongTinHS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThayDoiThongTinHS.Click
        Dim frm As New MH_ThayDoiThongTinHocSinh()
        frm.MdiParent = Me
        frm.Show()
    End Sub








    Private Sub btnBB_DSLop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBB_DSLop.Click
        Dim mh As New MH_InBaoCao()

        Dim bc As New BC_DanhSachLop()
        Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
        Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
        For Each tbCurrent In bc.Database.Tables
            tliCurrent = tbCurrent.LogOnInfo
            With tliCurrent.ConnectionInfo
                .ServerName = Application.StartupPath + "\0865059_0865125_QuanLiHocSinh.mdb"
                '.UserID = "" 
                '.Password = "" 
                '.DatabaseName = "" 
            End With
            tbCurrent.ApplyLogOnInfo(tliCurrent)
        Next tbCurrent
        mh.crvBaoCao.ReportSource = bc

        mh.Show()
    End Sub

    Private Sub btnBB_DSMonHoc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBB_DSMonHoc.Click
        Dim mh As New MH_InBaoCao()

        Dim bc As New BC_DanhSachMonHoc()
        Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
        Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
        For Each tbCurrent In bc.Database.Tables
            tliCurrent = tbCurrent.LogOnInfo
            With tliCurrent.ConnectionInfo
                .ServerName = Application.StartupPath + "\0865059_0865125_QuanLiHocSinh.mdb"
                '.UserID = "" 
                '.Password = "" 
                '.DatabaseName = "" 
            End With
            tbCurrent.ApplyLogOnInfo(tliCurrent)
        Next tbCurrent
        mh.crvBaoCao.ReportSource = bc

        mh.Show()
    End Sub

    Private Sub btnBB_DSHocSinh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBB_DSHocSinh.Click
        Dim mh As New MH_TuyChonBaoCaoDSHS()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnBB_BDLop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBB_BDLop.Click
        Dim mh As New MH_TuyChonBaoCaoBDLop()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnĐ_DBMonHoc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnĐ_DBMonHoc.Click
        Dim mh As New MH_TuyChonBaoCaoBDMH()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnBB_BDHocSinh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBB_BDHocSinh.Click
        Dim mh As New MH_TuyChonBaoCaoBDHS()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub MH_Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        rbtabDanhSach.Enabled = False
        rbtabPhatSinh.Enabled = False
        rbtabBaoBieu.Enabled = False
        rbtabTraCuu.Enabled = False
        rbtabBangDiem.Enabled = False
        rbtabQuanTri.Enabled = False

        btnDoiMK.Enabled = False
        btnDoiHinhNen.Enabled = False
        btnDangXuat.Enabled = False
    End Sub

    
    Private Sub btnDanhSachNguoiDung_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDanhSachNguoiDung.Click
        Dim mh As New MH_DanhSachNguoiDung
        mh.MdiParent = Me
        mh.Show()
    End Sub


    Private Sub btnThongTin_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThongTin.Click
        Dim mh As New MH_ThongTinChuongTrinh
        mh.ShowDialog()
    End Sub

    Private Sub btnBBTongKetHocKy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBBTongKetHocKy.Click
        Dim mh As New MH_TuyChonBaoCaoTongKetTheoHocKy()
        mh.MdiParent = Me
        mh.Show()
    End Sub

    Private Sub btnBBTongKetMon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBBTongKetMon.Click
        Dim mh As New MH_TuyChonBaoCaoTongKetTheoMonHoc
        mh.MdiParent = Me
        mh.Show()
    End Sub
End Class
